<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HDCMS后台登录 | 建站利器</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <script src="{{__ROOT__}}/public/js/jquery.min.js"></script>
    <script src="{{__ROOT__}}/public/js/common.js"></script>

    <link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/centaurus/css/bootstrap/bootstrap.min.css" />
    <!-- libraries -->
    <link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/centaurus/css/libs/font-awesome.css" />
    <link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/centaurus/css/libs/nanoscroller.css" />
    <!-- global styles -->
    <link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/centaurus/css/compiled/theme_styles.css" />
    <!-- this page specific styles -->
    <link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/centaurus/css/libs/ns-default.css"/>
    <link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/centaurus/css/libs/ns-style-growl.css"/>
    <link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/centaurus/css/libs/ns-style-bar.css"/>
    <link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/centaurus/css/libs/ns-style-attached.css"/>
    <link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/centaurus/css/libs/ns-style-other.css"/>
    <link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/centaurus/css/libs/ns-style-theme.css"/>

</head>
<body style="background:#f9f9f9;">
    <div class="container-fluid">
        <br/><br/>
        <div class="row">
            <div class="col-lg-8 col-lg-offset-1">
                <img src="{{__PUBLIC__}}/admin/login/img/logo.png" alt="Logo">
            </div>
            <div class="col-lg-3 text-right">
                <a href="{{__ROOT__}}">首页</a> |
                <a href="http://www.houdunwang.com">PHP实战培训</a> |
                <a href="http://www.hdphp.com">HDCMS官网</a>
            </div>
        </div>
        <br/>
        <!--登录-->
        <div class="row">
            <div class="col-sm-6 col-lg-offset-1">
                <img src="{{__PUBLIC__}}/admin/login/img/login_bg.jpg" alt="">
            </div>
            <div class="col-sm-4">
                <h2 style="margin-left:0px;padding:0px;">后台登录</h2>
                <form onsubmit="return false">
                  <div class="form-group">
                    <label for="username">帐号</label>
                    <input type="text" class="form-control input-lg" name="username" id="username" required>
                </div>
                <div class="form-group">
                    <label for="password">密码</label>
                    <input type="password" class="form-control input-lg" name="password" id="password" required>
                </div>
                <div class="form-group">
                    <label for="code">验证码</label>
                    <div class="row">
                        <div class="col-md-7" style="padding-right:0px;">
                            <input type="text" class="form-control" name="code" id="code" required >
                        </div>
                        <div class="col-md-5">
                         <img src="{{U('code')}}" class="code" style="cursor: pointer;float:left;"
                         onclick="this.src='{{U('code')}}&'+Math.random()"/>
                     </div>
                 </div>
             </div>
             <input type="submit" class="btn btn-lg btn-success" id="submit" value="登录">
         </div>
     </form>

 </div>
</div>
</div>
    <!--提示窗口Start-->
    <script src="{{__PUBLIC__}}/centaurus/js/modernizr.custom.js"></script>
    <script src="{{__PUBLIC__}}/centaurus/js/classie.js"></script>
    <script src="{{__PUBLIC__}}/centaurus/js/notificationFx.js"></script>
    <!--提示窗口End-->

    <script>
        $('form').submit(function(){
            $('#submit').attr('disabled','disabled');
            $.ajax({
                url:"{{U('doLogin')}}",
                data:$('form').serialize(),
                type:'POST',
                dataType:'JSON',
                success:function(result)
                {
                    if(result.code==0)
                    {
                        dialog(result.message,'success',1000,function()
                        {
                            location.href='/cms/index';
                        });
                    }
                    else
                    {
                        dialog(result.message,'error',1000);    
                    }
                    $('#submit').removeAttr('disabled');
                }
            })
            return false;
        });
    </script>
</body>
</html>